public class BulbSwitch {

    public static void main(String[] args) {
        BulbSwitch bulbSwitch = new BulbSwitch();
        System.out.println(bulbSwitch.bulbSwitch(11));
    }

    public int bulbSwitch1(int n) {
        if (n == 0) return 0;
        int[] nums = new int[n + 1];
        for (int i = 2; i <= n; i++) {
            for (int j = i; j <= n; j += i) {
                nums[j]++;
            }
        }
        int ans = 0;
        for (int i = 1; i < n + 1; i++) {
            if (nums[i] % 2 == 0) ans++;
        }
        return ans;
    }

    public int bulbSwitch(int n) {
        return (int) Math.sqrt(n);
    }
}
